package com.example.repair;

import android.content.Context;
import android.os.Handler;

import com.facebook.drawee.backends.pipeline.Fresco;

public class Application extends android.app.Application {

    /** 主线程ID */
    private static Thread mMainThread;
    /** 主线程ID */
    private static int mMainThreadId = -1;
    /** 主线程Handler */
    private static Handler mMainThreadHandler;

    /**
     * context 全局唯一的上下文
     */
    private static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        Fresco.initialize(this);
        context = this;
        mMainThread = Thread.currentThread();
        mMainThreadId = android.os.Process.myTid();
        mMainThreadHandler = new Handler();

    }


    public static Context getContext() {
        return context;
    }


    /** 获取主线程 */
    public static Thread getMainThread() {
        return mMainThread;
    }

    /** 获取主线程ID */
    public static int getMainThreadId() {
        return mMainThreadId;
    }
    /** 获取主线程的handler */
    public static Handler getMainThreadHandler() {
        return mMainThreadHandler;
    }

}
